import React, { Component } from 'react'

export default class List extends Component {
  render() {
    const { isFirst, isLoading, err, list } = this.props
    console.log(list)
    return (
      <div className="list">
        {
          isFirst ? <h2>输入关键词，然后点击搜索按钮</h2> :
          isLoading ? <h2>查询中，请稍后....</h2> :
          err ? <h2>{err}</h2> :
          list.map(item => {
            return (
              <div key={ item.id }>
                <div>{ item.sName }</div>
                <div>{ item.age }</div>
              </div>
            )
          })
        }
      </div>
    )
  }
}
